reimp -d libmysql.lib
dlltool -k -d libmysql.def -l libmysql.a

from: http://blog.csdn.net/mzlogin/article/details/5605320